
% save fig_trunc95.mat
%clear all
%load fig_Reiter.mat
%save fig_Reiter95.mat




clc;
%close all;
delta = 0.025;
load ('fig_trunc0.1.mat','C1','C2','C3','ut_eps','Bt_eps','Yt_eps','It_eps','Lt_eps','Ct_eps','C1t_eps','C2t_eps','C3t_eps','kappa_eps')

coef = ut_eps(1);

Btr = Bt_eps/coef;
Ytr = Yt_eps/coef;
Itr = It_eps/coef;
Ltr = Lt_eps/coef;
Ctr = Ct_eps/coef;
C1tr = C1t_eps/coef;
C2tr = C2t_eps/coef;
C3tr = C3t_eps/coef;
ut_eps2 = ut_eps/coef;
kappatr = kappa_eps/coef;

C1t = C1;
C2t = C2;
C3t = C3;


load ('fig_Reiter0.1.mat','C1','C2','C3','ut_eps','Bt_eps','Yt_eps','It_eps','Lt_eps','Ct_eps','C1t_eps','C2t_eps','C3t_eps','kappa_eps')

coef = ut_eps(1);

Br = Bt_eps/coef;
Yr = Yt_eps/coef;
Ir = It_eps/coef;
Lr = Lt_eps/coef;
Cr = Ct_eps/coef;
C1r = C1t_eps/coef;
C2r = C2t_eps/coef;
C3r = C3t_eps/coef;
kappar = kappa_eps/coef;

C1re = C1;
C2re = C2;
C3re = C3;



%%
%%
LL = length(ut_eps);%length(B_eps);
LL = 400;
X=1:1:LL;

LL2 = 40;
X2=1:1:LL2;


nx = 1;
ny = 5;

figure;
 
subplot(nx,ny,1);
plot(X2,ut_eps2(1:LL2),'k-','LineWidth',2);
title('1. G');
%ylim([-0.4 1.5]);



subplot(nx,ny,2);
plot(X,Ctr(1:LL),'k-',X,Cr(1:LL),'b--','LineWidth',2);
title('2. C');
%ylim([-0.02 0.]);

subplot(nx,ny,3);
plot(X2,Itr(1:LL2),'k-',X2,Ir(1:LL2),'b--','LineWidth',2);
title('3. I');
%ylim([-0.8 0.1]);
legend('Trunc.','Reiter','Location','southwest')
legend boxoff 

subplot(nx,ny,4);
plot(X,Btr(1:LL),'k-',X,Br(1:LL),'b--','LineWidth',2);
title('4. B');
%subplot(3,3,2);
%plot(X,Ytr(1:LL),'k-',X,Yr(1:LL),'b--');
%title('2. Y');
%ylim([0. .3]);
%ylim([0.0 0.1]);


subplot(nx,ny,5);
plot(X,100*kappatr(1:LL),'k-',X,100*kappar(1:LL),'b--','LineWidth',2);
title('5. kappa');
%ylim([-0.02 0.]);

%subplot(3,2,2);
%plot(X,Ctr(1:LL),'k-',X,Cr(1:LL),'b--');
%title('3. C');
%ylim([0. .2]);

%subplot(3,3,4);
%plot(X,Ltr(1:LL),'k-',X,Lr(1:LL),'b--');
%title('4. L');
%ylim([-2 1]);

% 
% subplot(nx,ny,6);
% plot(X,C1tr(1:LL),'k-',X,C1r(1:LL),'b--');
% title('6. C1');
% 
% subplot(nx,ny,7);
% plot(X,C2tr(1:LL),'k-',X,C2r(1:LL),'b--');
% title('6. C2');
% 
% subplot(nx,ny,8);
% plot(X,C3tr(1:LL),'k-',X,C3r(1:LL),'b--');
% title('6. C3');
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cdif = abs(Ctr-Cr);
Idif = abs(Itr-Ir);
Bdif = abs(Btr-Br);
kappadif = 100*abs(kappatr-kappar);

Cmean = mean(Cdif)
Cmax = max(Cdif)
Imean = mean(Idif)
Imax = max(Idif)
Bmean = mean(Bdif)
Bmax = max(Bdif)
kappamean = mean(kappadif)
kappamax = max(kappadif)



